package com.yum.ms.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Yum
 * @version 1.0
 *  Topic模式
 */
//@Configuration
//public class MQTopicConfig {
//    public static final String QUEUE01 = "queue_topic01";
//    public static final String QUEUE02 = "queue_topic02";
//    public static final String EXCHANGE = "topicExchange";
//    public static final String ROUTINGKEY01 = "#.queue.#";
//    public static final String ROUTINGKEY02 = "*.queue.#";
//
//
//
//    @Bean
//    public Queue queue01() {
//        return new Queue(QUEUE01);
//    }
//
//    @Bean
//    public Queue queue02() {
//        return new Queue(QUEUE02);
//    }
//
//    // 交换机
//    @Bean
//    public TopicExchange topicExchange() {
//        return new TopicExchange(EXCHANGE);
//    }
//    @Bean
//    // 将队列绑定到交换机上
//    public Binding binding01() {
//        return BindingBuilder.bind(queue01()).to(topicExchange()).with(ROUTINGKEY01);
//    }
//    @Bean
//    // 将队列绑定到交换机上
//    public Binding binding02() {
//        return BindingBuilder.bind(queue02()).to(topicExchange()).with(ROUTINGKEY02);
//    }
//}
